cmake_minimum_required(VERSION 2.8)

#set(base_src "common/*.c")
file(GLOB base_src "common/*.c")

	
if (${UNIX_OS})
	include_directories(
		${PROJECT_SOURCE_DIR}/include
		${PROJECT_SOURCE_DIR}/extensions/include
		${by3rd_library_include}
		/usr/local/include
		/opt/local/include
		/usr/include
		)
	link_directories(/opt/local/lib)
elseif (${WIN_OS})

else()

endif()




set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}/)

add_library(base STATIC ${base_src})

set_target_properties(base PROPERTIES OUTPUT_NAME "base")

set_target_properties(base PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -pthread -Wl,--no-as-needed -frtti -Wall -fPIC -Werror -fexceptions")

if(CMAKE_BUILD_TYPE STREQUAL Debug)
	set_target_properties(base PROPERTIES COMPILE_FLAGS "-g3 -fPIC")
endif()

if(CMAKE_BUILD_TYPE STREQUAL Release)
	set_target_properties(base PROPERTIES COMPILE_FLAGS "-O3 -fPIC")
endif()

target_link_libraries(base pthread)

install(TARGETS base 
	LIBRARY DESTINATION bin
	ARCHIVE DESTINATION bin)
